<?php
class TreeGetProgressAction extends SzAbstractAction
{
    Protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
    );

    /**
     * @param $userId
     * @return SzResponse
     * @throws SzException
     */
    public function execute($userId) {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_TREE)) {
            return $this->buildResponse(false);
        }

        return $this->buildResponse(array(
           'info' => TreeService::get()->getProgress($userId)
        ));
    }
}